package com.wanxi.interceptor.config;

import com.wanxi.interceptor.MyInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

public class InterceptorConfig   implements WebMvcConfigurer {
    @Resource
    private MyInterceptor cros;

    /* (non-Javadoc)
     * @see org.springframework.web.servlet.config.annotation.WebMvcConfigurer#addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry)
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(cros).addPathPatterns("/**");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
